﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class 实验三_3_4_3_4 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        GridView1.DataSource = null;
        GridView1.DataBind();
    }

    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {
       Response.Write(GridView1.SelectedValue);
        StudentClassesDataContext db = new StudentClassesDataContext();
        var s = db.Student.Where((x) => x.id == GridView1.SelectedValue.ToString()).First();
        Response.Write(s.name + "-"+ s.score + "" + s.img + "-" + s.Course.cname + "-" + s.cid);
    }
}